import { request } from '@umijs/max';

/** 加载聊天记录 GET /api/chat/data */
export async function getChatData(
  params: {
    userId:number,
    chatId:number,
  },
  options?: { [key: string]: any }
) {
  return request<API.ChatData[]>('/api/chat/data', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  })
}

/** 加载好友列表 GET /api/chat/friends */
export async function getChatFriends(
  userId:number,
  options?: { [key: string]: any }
) {
  return request<API.ChatFriends[]>('/api/chat/friends', {
    method: 'GET',
    params:{
      id:userId
    },
    ...(options || {}),
  })
}
